﻿var _cookieStr = "miserblog_person";
var _cooliePName = 'pName';


//登入
var defaultBarWidth = 350;
$(function () {
    var pCookiePos = document.cookie.indexOf(_cookieStr);
    var pCookie = document.cookie.substring(pCookiePos + _cookieStr.length + 1);
    var pName = '';
    var pCookieArray = pCookie.split('&');
    var item;
    for (var i in pCookieArray) {
        item = pCookieArray[i].split('=');
        if (typeof item != 'undefined' && item[0] == _cooliePName) {
            pName = item[1];
            break;
        }
    }
    if (pName != '') {
        $('#head_UserName').html('欢迎，' + pName);
    }
    else {
        $('#head_UserName').html('<a href="/account/LogOn">登入</a>');
    }
});
$(function () {
    //        SyntaxHighlighter.config.clipboardSwf = 'scripts/clipboard.swf';
    //        SyntaxHighlighter.all();
//    SyntaxHighlighter.config.bloggerMode = true;
//    SyntaxHighlighter.config.clipboardSwf = '/scripts/dp.SyntaxHighlighter/Scripts/clipboard.swf';
    //SyntaxHighlighter.all();

    winResize();
    $('#rightBar').show();
});
$(window).resize(function () { winResize(); setTimeout("winResize()", 1000); });
function winResize() {
    var width = $(".page").width() - defaultBarWidth;
    $('#main').css('width', width + 'px');
}